/**
 * @Author: 焦质晔
 * @Date: 2019/6/20
 * @Last Modified by: mikey.zhaopeng
 * @Last Modified time: 2019-11-13 15:05:59
 */
import axios from '@/api/fetch';
import * as types from './types';
import SERVER from '@/api/server';

// 获取用户信息
export const getUsersList = params => axios.get(`${SERVER.DMSCLOUD_BASEDATA}/basedata/employees`, { params });
// 新增用户信息
export const addUserInfo = params => axios.post(`${SERVER.DMSCLOUD_BASEDATA}/basedata/employees`, params );
// 根据id获取用户信息
export const getUserInfoById = (params, id) => axios.get(`${SERVER.DMSCLOUD_BASEDATA}/basedata/employees/epmloyee/${id}`, { params });
// 编辑用户信息
export const editUserInfo = (params, id) => axios.put(`${SERVER.DMSCLOUD_BASEDATA}/basedata/employees/epmloyee/${id}`, params );
// 获取部门树
export const getOrgsTree = params => axios.put(`${SERVER.DMSCLOUD_BASEDATA}/basedata/orgs/getIsValid/Orgs`, params );
// 查询组织树列表
export const getComOrgTreeList = params => axios.get(`${SERVER.GMSCLOUD_MANAGE}/company/org/tree`, { params });
export const getComOrgTreeLists = params => axios.get(`${SERVER.GMSCLOUD_MANAGE}/org/trees`, { params });
// 查询组织树列表-去重
export const getComOrgTreeListDistinct = params => axios.get(`${SERVER.GMSCLOUD_MANAGE}/company/org/treeDistinct`, { params });

//查询身份证号是否已绑定
export const checkCertificateId = id => axios.get(`${SERVER.DMSCLOUD_BASEDATA}/emp/checkCertificateId?certificateID=${id}`);

//带入数据
export const postEmployee = params => axios.post(`${SERVER.DMSCLOUD_BASEDATA}/basedata/employees/employee`, params );
//第一二三岗位数据
export const getPresetRole = params => axios.get(`${SERVER.DMSCLOUD_BASEDATA}/basedata/roles/getPresetRole`);




